1. Field of the Invention
The present invention relates to an image processing apparatus and method for performing error diffusion processing to convert multi-tone image data to binary image data capable of representing intermediate gradation.
2. Description of Prior Arts
A copier or scanner has an scanning unit with a photoelectric device like a CCD (Charge Coupled Device) in which light is emitted to an original so that the CCD will receive the reflected light from the original and convert the radiant energy of light to an analog electrical signal corresponding to the intensity of the light. Then, the analog electrical signal is subjected to A/D conversion so that a digital electric signal corresponding to the original image will be outputted. For example, if the output digital electrical signal represents 10 bits per pixel, it will mean that the copier or scanner provides monochroic gradation of 1024 levels for each pixel.
In general, the digital electrical signal is subjected to various processing, such as correction of sensitivity variations in the photoelectric device, luminance-density conversion, MTF correction, and noise elimination and so on, and converted to 8-bit image data that represents each pixel with image of gradation of 256 levels. The multi-tone image data are then binarized by error diffusion, that is, it is converted to binary image data that represents each pixel by one bit deep (either black or white) so that the binary image data will be used as image data to be sent to a printer unit or facsimile unit.
In conversion of multi-tone image data to binary image data with gradation of two levels (normally black and white), density of each pixel is compared with a predetermined threshold value. When the density is higher than the threshold value, the pixel is represented as black, while the density is lower than the threshold value, the pixel is represented as white. If the density of 256-level image data is “200” and the threshold value is “128,” the pixel is determined as black. In such a simple binarization technique, all pixels with density values ranging from “0” to “127” are converted to black and other pixels with density values of “128” to “255” are converted to white, resulting in loss of gradation of the original image data.
To cope with this problem, there have been proposed error diffusion methods as binarization methods which can give gradation or appearance of gray levels or halftones by means of plural pixels when viewed at a distance even though each pixel is represented with one bit deep, either black or white. The error diffusion methods are basically intended to preserve gradation of the original information by distributing the error or difference between the density of a binarized pixel (black or white) and its original density to neighboring, unprocessed pixels. For example as shown in FIG. 17, if multi-tone image data represented in 256 levels of pixel density ranging from “0” to “255” is binarized with a threshold level of “128”, pixel 901 having a density of “255”is originally a black pixel and therefore an error is “0”. Pixel 902 having a density of “126” exhibits a difference 912 of “126” from the density level of 255, that is, from the density of completely black, and pixel 903 having a density of “200” exhibits a difference 913 of “55” from the density of completely black.
In the error diffusion process, the error produced in the binarization process is carried over and distributed to neighboring, unprocessed pixels. Taking the pixel 903 having a density level of “200” as an example, the pixel is a little bit whitish gray (density 200) in comparison with complete black (density 255) after being binalized, so that the information indicating that it is a little bit more whitish than complete black (an error of −55 between density 200 and density 255) is distributed to neighboring, unprocessed pixels.
In the error diffusion process, since the error in density produced upon binarization of a pixel being processed is carried over and distributed to neighboring, unprocessed pixels, it is necessary to process the image data in a given direction, for example, from the beginning to the end of a page, or from the beginning to the end of a line.
Japanese Patent Laid-Open No. 2000-158714 discloses an image processing apparatus in which error diffusion is appropriately applied to a long-length image to be printed across two or more pages under such a limitation. In this apparatus, the error diffusion process is applied to every new page while attending to errors produced on previous pages by not initializing between pages error data buffer storing errors produced when binalizing.
Japanese Patent Laid-Open No. 2002-237952 as another example of prior art discloses. In a technique in which a page is divided into multiple bands to perform error diffusion while managing an error buffer on a band basis, thereby reducing the necessary memory capacity size without degrading image quality at banding joints.
When a scanner or the like scans image data line by line, if time required to perform error diffusion on one line of multi-tone image data is shorter than one-line scanning time of the scanner, real-time error diffusion can be performed in step with the scanning speed of the scanner.
However, as a number of pixels per line increases, such as a case of scaling up while scanning, the error diffusion process may not be able to keep up with the scanning cycle. In such a case, one page of multi-tone image data needs to be stored in a page memory)prior to performing the error diffusion process. For example, scanning an A4 image at 600 dpi requires a memory size of about 32 Mbytes. Further, since the error diffusion process can start only after the multi-tone image data has been completely stored in the one-page memory, it takes much time to create binary image data, and hence delays subsequent processing.